# -*- coding: utf-8 -*-
"""
@time：  2021/06/03  20:17
@Auto：Mr. xingye  993843278
@Company 星野训练营 99384378@qq.com
@Function:手q

"""
from appium import webdriver

caps ={
  "platformName": "Android",
  "platformVersion": "6.0.1",
  "deviceName": "127.0.0.1:7555",
  "appPackage": "com.tencent.mobileqq",
  "appActivity": ".activity.SplashActivity",
  "noReset": True,
  "unicodeKeyboard": True,
  "resetKeyboard" : True,
  "automationName": "uiautomator1"
}

driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub",caps)
driver.implicitly_wait(10)

#C:\Users\Xy\AppData\Local\Programs\Appium\resources\app\node_modules\appium\build\lib
el1 = driver.find_element_by_accessibility_id("请输入QQ号码或手机或邮箱")
el1.clear()
el1.send_keys("506135307")
el2 = driver.find_element_by_accessibility_id("密码 安全")
el2.clear()
el2.send_keys("RainQAQ999")
el3 = driver.find_element_by_accessibility_id("登 录")
el3.click()
el4 = driver.find_element_by_accessibility_id("帐户及设置")
el4.click()
el5 = driver.find_element_by_accessibility_id("设置")
el5.click()
el6 = driver.find_element_by_accessibility_id("帐号管理")
el6.click()
el7 = driver.find_element_by_accessibility_id("退出当前帐号按钮")
el7.click()
el8 = driver.find_element_by_id("com.tencent.mobileqq:id/dialogRightBtn")
el8.click()
driver.quit()